"""
存储类型
"""

from typing import Any, Dict
from enum import Enum
from pydantic import BaseModel


class MemoryType(str, Enum):
    """智能体的记忆类型"""
    SHORT_TERM = "short_term"       # 近期会话记录
    SUMMARY = "summary"             # 近期会话摘要
    WORKING = "working"             # 当前推理上下文
    EPISODIC = "episodic"           # 场景对话
    SEMANTIC = "semantic"           # 事实性知识
    PROCEDURAL = "procedural"       # 操作知识/模式
    TOOL_CONTEXT = "tool_context"   # 工具之间共享的上下文
    PLAN_MEMORY = "plan_memory"     # 规划和执行历史


class MemoryEntry(BaseModel):
    id: str
    content: Any
    memory_type: MemoryType
    timestamp: float
    metadata: Dict[str, Any]
    importance: float = 0.5    # 0.0 ~ 1.0
    access_count: int = 0
    last_accessed: float = 0.0
